feat: Include and exclude targets by tag for deployments and runbook runs - #585
Open
bec-callow-oct wants to merge 7 commits into
Open
feat: Include and exclude targets by tag for deployments and runbook runs#585bec-callow-oct wants to merge 7 commits into
bec-callow-oct wants to merge 7 commits into
Conversation
bec-callow-oct
marked this pull request as ready for review
April 14, 2026 00:45
bec-callow-oct
force-pushed
the
fnm/include-exclude-targets-by-tag
branch
from
August 27, 2026 02:20
d35d014 to
c4db39c
Compare
mik-ky
requested changes
Aug 27, 2026
mik-ky
left a comment
Contributor
There was a problem hiding this comment.
While playing around in interactive mode, I noticed runbooks don't allow you to change the additional/advanced options:
➜ ./octopus runbook run --project TagTest --name TagRunbook --environment Development
Runbook TagRunbook
Environments Development
Additional Options:
Run At: Now
Skipped Steps: None
Guided Failure Mode: Use default setting from the target environment
Priority: Do not jump the task queue
Package Download: Use cached packages (if available)
Run Targets: All included
Target Tags: All included
? Change additional options? Change
? Scheduled start time Now
? Guided Failure Mode Use default setting from the target environment
? Package download Use cached packages (if available)
? Steps to skip (If none selected, run all steps)
? Run targets (If none selected, run on all)
Automation Command: octopus runbook run --space 'Default' --project 'TagTest' --name 'TagRunbook' --environment 'Development' --no-prompt
Successfully started 1 runbook run(s)
which is in contrast to deployments:
❯ ./octopus release deploy --project TagTest --version 0.0.1 --environment Development
Project TagTest
Release 0.0.1
Environments Development
Additional Options:
Deploy Time: Now
Skipped Steps: None
Guided Failure Mode: Use default setting from the target environment
Priority: Use default setting from the lifecycle phase
Package Download: Use cached packages (if available)
Deployment Targets: All included
Target Tags: All included
? Change additional options? Change
? Scheduled start time Now
? Steps to skip (If none selected, run all steps)
? Guided Failure Mode Do not use guided failure mode
? Package download Use cached packages (if available)
? Deployment targets (If none selected, deploy to all)
? Specific target tags to include (If none selected, include all) Default Target Tags/cloud-region
Automation Command: octopus release deploy --space 'Default' --project 'TagTest' --version '0.0.1' --environment 'Development' --guided-failure 'false' --specific-target-tag 'Default Target Tags/cloud-region' --no-prompt
Successfully started 1 deployment(s)
Other than that one inconsistency, they are looking great.
Interactive runbook run listed target tags in the additional options summary but never asked about them, so they could only be set via flags. Release deploy already prompts, making the two inconsistent. Ask for the tags to include (and to exclude, when none were included) after the run targets question, for both database and Git runbooks, matching the release deploy flow. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three groups of failures after merging main: - PrintAdvancedSummary expectations predate the "Target Tags" line, as main's --priority tests were written before it existed. - Two interactive deploy tests deadlocked: they answer "Change" and so now reach the target tags step, which fetches a deployment preview the mock server was never told to serve. Two scheduled start time tests hit the same problem. Serve the extra preview; the responses declare no tag sets, so the tag questions are skipped. - The "doesn't ask if all opts are supplied" tests no longer supplied every advanced option once target tags joined the set, so they were offered the additional options question and hung waiting on it. Give them a tag option so they cover what their name describes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two new flags for specific and excluded target tag names on deployments and runbook runs:
--specific-target-tag--excluded-target-tagThe new tags accept single target tag canonical names and can be used more than once if including/excluding multiple tags.
Fixes SI-115
Requires the changes in this client PR OctopusDeploy/go-octopusdeploy#409
Interactive flow for specific target tags:

Interactive flow for excluded target tags:

Both include and exclude in a single command:

Multiple specific targets:

Multiple excluded targets:

Tags that don't exist
